{extend name="Layout/edit" /}
{block name="content"}
<!-- form start -->
<form class="form-horizontal" action="{:url('editSave')}" method="post">
    <div class="box-body">
        <div class="form-group">
            <label class="col-sm-2 control-label">菜单位置</label>
            <div class="col-sm-10">
                <select name="pid" data-url="{:url('getTreeJson')}" data-value="{$data.pid}"></select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">菜单名称</label>
            <div class="col-sm-10">
                <input type="text" name="title" class="form-control input-sm" placeholder="菜单名称" required="required" value="{$data.title}" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">菜单代码</label>
            <div class="col-sm-10">
                <input type="text" name="code" class="form-control input-sm" placeholder="菜单代码" value="{$data.code}" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">链接地址</label>
            <div class="col-sm-10">
                <input type="text" name="link_url" class="form-control input-sm" placeholder="链接地址" value="{$data.link_url}" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">打开目标</label>
            <div class="col-sm-10">
                <input type="text" name="open_target" class="form-control input-sm" placeholder="打开目标" value="{$data.open_target}" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">备注信息</label>
            <div class="col-sm-10">
                <input type="text" name="remark" class="form-control input-sm"  placeholder="备注信息" size="79" value="{$data.remark}" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">状态</label>
            <div class="col-sm-10">
                {xshtml:radio name="status" data='array("1"=>"显示","0"=>"隐藏")' value="data['status']|default='1'" /}
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">锁定</label>
            <div class="col-sm-10">
                {xshtml:checkbox name="is_lock" data='array("1"=>"是")' value="data['is_lock']" /}
            </div>
        </div>
    </div>
    <!-- /.box-body -->
    <div class="box-footer">
        <input type="hidden" name="id" value="{$data.id}" />
        <button type="button" class="btn btn-default xsui-btn-close-dialog">取消</button>
        <button type="submit" class="btn btn-primary pull-right">保存</button>
    </div>
    <!-- /.box-footer -->
</form>
{/block}
{block name="script_before"}
<script>
    $('select[name="pid"]').ajaxcombobox({first: {id: "", text: "选择上级部门"}});
</script>
{/block}